package routers

import (
	"github.com/astaxie/beego"
	"analysis-ss/controllers"
)

func init() {
	// 页面路由
	beego.Include(
		&controllers.PageController{},
	)
	// js文件
	beego.SetStaticPath("/views", "views")
	ns := beego.NewNamespace("/api",
		beego.NSNamespace("/center",
			beego.NSInclude(
				&controllers.CenterController{},
			),
		),
		beego.NSNamespace("/children",
			beego.NSInclude(
				&controllers.ChildrenController{},
			),
		),
		beego.NSNamespace("/teacher",
			beego.NSInclude(
				&controllers.TeacherController{},
			),
		),
		beego.NSNamespace("/course",
			beego.NSInclude(
				&controllers.CourseController{},
			),
		),
		beego.NSNamespace("/config",
			beego.NSInclude(
				&controllers.ConfigController{},
			),
		),
	)

	// 注册namespace
	beego.AddNamespace(ns)
}
